console.log('创建事件写入流');
var fs =require('fs');
var data="console.log(\"123\")";
var writerStream=fs.createWriteStream('output.js');
writerStream.write(data,'UTF8');
writerStream.end();
writerStream.on('finish',function(){
    console.log('写入完成');
});
writerStream.on('error',function(err){
    console.log(err.stack)
});
console.log('程序执行完毕');